char* trim(char *s)
{
	char *f=s, *e=0, *c=s;

	e=s +(strlen(s)) -1;
	while(*e==' '&&s<=e) e--;
	*(e+1)=0;

	while(*f==' '&&f<=e) f++;

	if (s!=f) {
    		while(f<=e) *(c++) = *(f++);
    		*c=0;
	}

	return s;
}

#if 0
main()
{

char xx[10];
char *yy;

strcpy(xx,"aa  ");

yy=(char *)trim((char *)xx);
printf("%s<\n", xx);
printf("%s<\n", yy);

}
#endif
